package com.nut.spp.enums;

import java.util.HashMap;
import java.util.Map;

/**
 * 商品类型 1会员 2粉丝代理套餐 3单商品 4商品套组
 */
public enum GoodsTypeEnum {

    Member(1, "1会员"),
    FansProxy(2, "2粉丝代理套餐"),
    Goods(3, "3单商品"),
    GoodsCompose(4, "4商品套组"),

    ;

    private Integer value;

    private String desc;

    GoodsTypeEnum(final Integer value, final String desc) {
        this.value = value;
        this.desc = desc;
    }

    private static Map<Integer, GoodsTypeEnum> map = new HashMap<>();

    static {
        for (GoodsTypeEnum stepEnum : GoodsTypeEnum.values()) {
            map.put(stepEnum.value, stepEnum);
        }
    }

    public static GoodsTypeEnum valueOf(int value) {
        return map.get(value);
    }

    public Integer getValue() {
        return this.value;
    }

    public String getDesc() {
        return this.desc;
    }
}
